package com.mp.service.impl;/**
 * @author MRD
 * 2019/8/22
 */

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mp.dao.WebsiteGameMapper;
import com.mp.pojo.Query.DelWebsiteFlyRecordQuery;
import com.mp.pojo.VO.WebsiteGameVO;
import com.mp.pojo.WebsiteGame;
import com.mp.service.WebsiteGameService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *@description:
 *@author: Ace
 *@create: 2019-08-22 09:13
 */
@Service
public class WebsiteGameServiceImpl extends ServiceImpl<WebsiteGameMapper,WebsiteGame> implements WebsiteGameService {

    @Autowired
    private WebsiteGameMapper websiteGameMapper;

    /***
     * 获取站点游戏
     * @param websiteId
     * @param adminId
     * @return
     */
    @Override
    public List<WebsiteGameVO> getWebsiteGameList(Integer websiteId,Integer adminId) {
       List<WebsiteGameVO> list = websiteGameMapper.getWebsiteGameList(websiteId,adminId);
       return list;
    }

    /**
     * 获取游戏信息
     * @param websiteGameId
     * @return
     */
    @Override
    public WebsiteGameVO getGameInfo(Integer websiteGameId,Integer adminId) {
        WebsiteGameVO websiteGameVO = websiteGameMapper.getGameInfo(websiteGameId,adminId);
        return websiteGameVO;
    }

    /**
     * 删除站点飞单记录
     * @param delWebsiteFlyRecordQuery
     * @return
     */
    @Override
    public boolean delWebsiteFlyRecord(DelWebsiteFlyRecordQuery delWebsiteFlyRecordQuery) {
        return websiteGameMapper.delWebsiteFlyRecord(delWebsiteFlyRecordQuery.getWebsiteUserId(),
                delWebsiteFlyRecordQuery.getWebsiteGameId(),delWebsiteFlyRecordQuery.getDelAmount());
    }
}
